package com.supreme.studyserver.service;

import com.supreme.studyserver.component.event.BlackHistoryEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SpringEventService {

    @Resource
    private ApplicationContext applicationContext;

    public void sendSimpleEvent(String eventSource, String eventTitle) {
        final BlackHistoryEvent blackHistoryEvent = new BlackHistoryEvent(eventSource, eventTitle);
        applicationContext.publishEvent(blackHistoryEvent);
    }
}
